package com.cloud.feign.service;

import com.cloud.feign.bean.User;
import com.cloud.feign.configure.FeignClientFallbackFactory;
import com.cloud.feign.configure.SchedualServiceHiHystric;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//
// 断路器两种实现方式
// fallback = SchedualServiceHiHystric.class
@FeignClient(value = "producer", fallbackFactory = FeignClientFallbackFactory.class)
public interface FeignClient1 {

    @GetMapping("/hi/{name}")
    String sayHiFromClientOne(@PathVariable(value = "name") String name);

    @PostMapping("/user")
    User getUser(@RequestBody User user);

    @GetMapping("/getList")
    List<User> getList();


}
